package com.vanzo.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.app.Fragment;

/**
 * Created by yaofang on 2018/3/5.
 * fragment的基类
 */

public abstract class BaseFragment extends Fragment{

    private View view;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(getFragmentLayoutId(), container , false);
        initView(view);
        initListener();
        initData();
        return view;
    }

    protected abstract int getFragmentLayoutId();

    protected abstract void initView(View view);

    protected abstract void initListener();

    protected abstract void initData();
}
